<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../../static/system_setup/js/base.js"></script>
    <link rel="stylesheet" href="../../static/system_setup/css/style.css">
    <link rel="stylesheet" type="text/css" href="../../static/personal_center/css/index.css">
    <link rel="stylesheet" type="text/css" href="../../static/personal_center/css/common.css">
    <script type="text/javascript" src="../../static/personal_center/js/index.js"></script>
    <script src="../../static/public_file/js/jquery.min.js"></script>
    <title>Title</title>
    <style>
        body, html {
            width: 100%;
            height: 100%;
            padding: 0;
            margin: 0;
        }
        #add_order {
            float: right;
            height: 30px;
            margin-top: 5px;
            margin-right: 10px;
            background: #00a0e9;
            color: white;
            line-height: 30px;
            width: 80px;
            border: #00a0e9 solid 1px;
            border-radius: 3px;
            font-size: 14px;
        }
        .top_tag {
            border-bottom: #01AAED solid 2px;
            color: #01AAED;
        }
        .tab_top {
            width: 100px;
            height: 38px;
            line-height: 38px;
            text-align: center;
            display: inline-block;
            cursor: pointer;
            font-size: 14px;
        }
        #loading {
            background: #fff url(../../static/public_file/images/jiazai.gif) no-repeat scroll center center;
            height: 100%; width: 100%; background-size: 10%; position: fixed; margin-top: 0px; top: 0px; left: 0px; bottom: 0px;
            overflow: hidden !important; right: 0px; z-index: 999999;background-color: rgba(255, 255, 255, 0.08);
        }
    </style>
</head>
<body>
    <div id="loading">
        <div id="loading-center">
        </div>
    </div>

    <div style="width: 100%;height: 40px;background: white;font-size: 0;padding-right: 15px;">
        <div id="buy-process" onclick="change_mind(this.id)" class="tab_top top_tag">
            采购流程
        </div>

        <div id="apply-process" onclick="change_mind(this.id)" class="tab_top">
            申请流程
        </div>

        <div id="approver_but" style="float: right;width: 110px;height: 40px;text-align: center;">
            <a href="javascript:;" style="text-decoration: none;"
               onclick="admin_add('添加表单','/personal-center/define_produce_view.html','1200','800')"><span class="l" id="add_order">创建流程</span></a>
        </div>
    </div>

    <div id="buy-page" style="width: 100%;height: 94%;">
        <iframe id="implant_page" src="" frameborder="0" style="width: 100%; height: 100%"></iframe>
    </div>

    <script type="text/javascript" src="../../static/system_setup/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="../../static/system_setup/js/H-ui.js"></script>
    <script type="text/javascript" src="../../static/system_setup/js/H-ui.admin.page.js"></script>
    <script type="text/javascript" src="../../static/system_setup/laypage/1.2/laypage.js"></script>
    <script>
        window.onload = function () {
            document.getElementById("loading").style.display = "none";
            document.getElementById('implant_page').src = "../personal-center/audit_form_deatil_view?process_name=purchase";
        }

        function admin_add(title,url,w,h){
            layer_show(title,url,w,h);
        }

        function layer_show(title,url,w,h){
            if (title == null || title === '') {
                title=false;
            };
            if (url == null || url === '') {
                url="404.html";
            };
            if (w == null || w === '') {
                w=800;
            };
            if (h == null || h === '') {
                h=($(window).height() - 50);
            };
            layer.open({
                type: 2,
                area: [w+'px', h +'px'],
                fix: false, //不固定
                maxmin: true,
                shade:0.4,
                title: title,
                content: url
            });
        }

        function layer_close(){
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        }

        function change_mind(tag_id) {
            if (tag_id === "buy-process") {
                document.getElementById(tag_id).className = "tab_top top_tag";
                document.getElementById("apply-process").className = "tab_top";
                document.getElementById('implant_page').src = "../personal-center/audit_form_deatil_view?process_name=purchase"
            } else {
                document.getElementById(tag_id).className = "tab_top top_tag";
                document.getElementById("buy-process").className = "tab_top";
                document.getElementById('implant_page').src = "../personal-center/audit_form_deatil_view?process_name=apply"
            }
        }
    </script>
</body>
</html>